<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ page import="java.util.*" %>
<%@ page import="beans.*" %>
<jsp:useBean id="DatosMaterias" scope="request" class="databeans.MateriaDataBean" />
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>EME:Listado de Materias</title>
        <link href="../css/estilos.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <sec:authorize ifAnyGranted="ROLE_SYSTEM">

        <table  border="0" width="100%">
            <thead>
                <tr>
                    <th >
                        <h1><img src="../images/EME2.png" width="175px"></h1>
                    </th>
                    <th >
                        <h1><img src="../images/headers/listaDeMaterias.png"></h1>
                    </th>
                </tr>
            </thead>
            <tbody>
             
                <tr>
                    <td width="200px" valign="top"
                        <div>
                            <jsp:include page="menu.jsp"/>
                        </div>
                    </td>
                    <td><center>
                        
                         <table  class="tabla1" width="90%">
                                    <thead>
                                        <tr>
                                            <th>Cod. Materia</th>
                                            <th> Nombre de Materia </th>
                                            <th> Ciclo</th>
                                           

                                        </tr>

                                    </thead>
                                    <tbody>
                                    <% //Iniciar scriplet
                                    List listaMaterias = DatosMaterias.getListaMaterias();
                                    Iterator it = listaMaterias.iterator();
                                    MateriaBean materia;
                                    while(it.hasNext()){
                                        materia = (MateriaBean) it.next();

                                    %>
                                    <tr>
                                        <td><%= materia.getCodMateria() %> </td>
                                        <td><%= materia.getNomMateria() %> </td>

                                        <%
                                        if(!materia.getCiclo().isEmpty() && materia.getCiclo()!=null){
                                        if(materia.getCiclo().equals("1")){ %>
                                        <td>CICLO I</td>
                                        <%}else if(materia.getCiclo().equals("2")){%>
                                        <td>CICLO II</td>
                                        <%}}else{%>
                                        <td></td>
                                        <%}%>
                                    </tr>
                                    <%
                                    //Terminar el scriptlet
                                        }
                                    %>
                                    </tbody>

                                </table>
                        </center>
                    </td>
                </tr>
            </tbody>
        </table>
    <div align="left">
    <jsp:include page="barrausuario.jsp"/>
    </div>
    </sec:authorize>
    </body>
</html>
